package com.android.Servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.android.Bean.ComRecruitBean;

@SuppressWarnings("serial")
public class ComRecruitInsertServlet extends HttpServlet {

	/**
	 * 企业发布招聘信息
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setCharacterEncoding("gbk");
		String comRName = request.getParameter("comRName");
		String comRReq = request.getParameter("comRReq");
		String comRCon = request.getParameter("comRCon");
		String comRJob = request.getParameter("comRJob");
		String comRMon = request.getParameter("comRMon");
		String comRDate = request.getParameter("comRDate");
		String comRPlace = request.getParameter("comRPlace");
		PrintWriter pw = response.getWriter();
		ComRecruitBean comRecruitInsertBean = new ComRecruitBean();
		try {
			comRecruitInsertBean.recruitInsert(comRName, comRReq, comRCon, comRJob, comRMon, comRDate, comRPlace);
			pw.append("true");
			pw.flush();
		} catch (ClassNotFoundException e) {
			pw.append("false");
			pw.flush();
			e.printStackTrace();
		} catch (SQLException e) {
			pw.append("false");
			pw.flush();
			e.printStackTrace();
		}
	}

}
